package cn.codergege.shiro.chapter6.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.codergege.shiro.chapter6.dao.RoleDao;
import cn.codergege.shiro.chapter6.model.Role;
import cn.codergege.shiro.chapter6.service.RoleService;

@Service("roleService")
public class RoleServiceImpl implements RoleService {
	@Resource
	private RoleDao roleDao;

	@Override
	public Role createRole(Role role) throws Exception {
		return roleDao.createRole(role);
	}

	@Override
	public void deleteRole(Long roleId) throws Exception {
		roleDao.deleteRole(roleId);
	}

	@Override
	public void correlationPermissions(Long roleId, Long... permissionIds) throws Exception {
		roleDao.correlationPermissions(roleId, permissionIds);
	}

	@Override
	public void uncorrelationPermissions(Long roleId, Long... permissionIds) throws Exception {
		roleDao.uncorrelationPermissions(roleId, permissionIds);
	}

}
